﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Yyyg.Models;

namespace Yyyg.IBLL
{
   public interface IGoodsService:ITableServiceBase<Goods>
    {
        /// <summary>
        /// 添加商品
        /// </summary>
        bool Add(string guid, string title, decimal price, int needamo, int tyid, int stock, string brin, string main_url, string detImgsJsonUrl, string subImgsJsonUrl, bool enable = true);


        /// <summary>
        /// 添加商品
        /// </summary>
        bool Add(Goods good);


        /// <summary>
        /// 异步查询所有商品信息
        /// </summary>
        /// <returns></returns>
        List<Goods> GetAll();


        /// <summary>
        /// 根据Guid查询商品
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        Goods QueryGoodByGuid(string guid);


        /// <summary>
        /// 根据参数异步查询商品信息
        /// </summary>
        /// <param name="qpar"></param>
        /// <returns></returns>
        List<Goods> QueryGoods(string qpar);


        /// <summary>
        /// 根据分页信息异步查询商品,页码从1开始
        /// </summary>
        /// <param name="pnumber"></param>
        /// <returns></returns>
        List<Goods> QueryGoodsPage(int pnumber);


        /// <summary>
        /// 获取总页数
        /// </summary>
        /// <returns></returns>
       int GetSumPages();


        /// <summary>
        /// 返回商品分类一二级列表
        /// </summary>
        /// <returns></returns>
        Pair<string, string>[][] GetTypes();


        /// <summary>
        /// 删除指定商品
        /// </summary>
        /// <param name="guid"></param>
        /// <returns></returns>
        bool DelGood(string guid);
    }
}
